﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace TPCN.DAL
{
   public class ConfigObj
    {
        private string _ConfigID;

        public string ConfigID
        {
            get { return _ConfigID; }
            set { _ConfigID = value; }
        }
        private string _DefaultTitle;

        public string DefaultTitle
        {
            get { return _DefaultTitle; }
            set { _DefaultTitle = value; }
        }
        private string _DefaultKeyword;

        public string DefaultKeyword
        {
            get { return _DefaultKeyword; }
            set { _DefaultKeyword = value; }
        }
        private string _DefaultDescription;

        public string DefaultDescription
        {
            get { return _DefaultDescription; }
            set { _DefaultDescription = value; }
        }
        private string _SaleEmail;

        public string SaleEmail
        {
            get { return _SaleEmail; }
            set { _SaleEmail = value; }
        }
        private string _TypeMail;

        public string TypeMail
        {
            get { return _TypeMail; }
            set { _TypeMail = value; }
        }
        private string _NoreplyMail;

        public string NoreplyMail
        {
            get { return _NoreplyMail; }
            set { _NoreplyMail = value; }
        }
        private string _NoreplyPass;

        public string NoreplyPass
        {
            get { return _NoreplyPass; }
            set { _NoreplyPass = value; }
        }
        public ConfigObj SetValuesFromDataReader(IDataReader reader)
        {
            ConfigObj obj = new ConfigObj();
            obj.ConfigID = (reader["ConfigID"] is DBNull) ? String.Empty : reader["ConfigID"].ToString();
            obj.DefaultTitle = (reader["DefaultTitle"] is DBNull) ? String.Empty : reader["DefaultTitle"].ToString();
            obj.DefaultKeyword = (reader["DefaultKeyword"] is DBNull) ? String.Empty : reader["DefaultKeyword"].ToString();
            obj.DefaultDescription = (reader["DefaultDescription"] is DBNull) ? String.Empty : reader["DefaultDescription"].ToString();
            obj.SaleEmail = (reader["SaleEmail"] is DBNull) ? String.Empty : reader["SaleEmail"].ToString();
            obj.TypeMail = (reader["TypeMail"] is DBNull) ? String.Empty : reader["TypeMail"].ToString();
            obj.NoreplyMail = (reader["NoreplyMail"] is DBNull) ? String.Empty : reader["NoreplyMail"].ToString();
            obj.NoreplyPass = (reader["NoreplyPass"] is DBNull) ? String.Empty : reader["NoreplyPass"].ToString();
            return obj;
        }
    }
}
